/**
 * 
 */
package org.chengsen.app;

import java.sql.Date;

import org.chengsen.dao.UserDAO;
import org.chengsen.dataobject.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Jason.zhang
 * 
 */
public class AppMain {
	public static void main(String[] args) {
		xmlWebConfig();
	}

	/**
	 * 普通web bean 获取例子
	 */
	public static void xmlWebConfig() {
		ApplicationContext context = new ClassPathXmlApplicationContext(
				"allBeanLocation.xml");
		UserDAO userDAO = (UserDAO) context.getBean("userDAO");
		User user = new User("chengsen", "zhang", new Date(
				System.currentTimeMillis()), "0221062008");

		userDAO.save(user);
	}
}
